package com.dtw.ditouwang.models;

import com.dtw.ditouwang.beans.AssetsBean;
import com.dtw.ditouwang.beans.ChallengeListBean;
import com.dtw.ditouwang.beans.CommentBean;
import com.dtw.ditouwang.beans.CommentDetialBean;
import com.dtw.ditouwang.beans.CommonBean;
import com.dtw.ditouwang.beans.FrequenctBean;
import com.dtw.ditouwang.beans.HelpBean;
import com.dtw.ditouwang.beans.HelpBeanList;
import com.dtw.ditouwang.beans.HelpContentBean;
import com.dtw.ditouwang.beans.HomeBean;
import com.dtw.ditouwang.beans.EditorChooseBean;
import com.dtw.ditouwang.beans.MoreBean;
import com.dtw.ditouwang.beans.MovementBackBean;
import com.dtw.ditouwang.beans.MovementFragmentBean;
import com.dtw.ditouwang.beans.MyMedalBean;
import com.dtw.ditouwang.beans.NotifyBean;
import com.dtw.ditouwang.beans.OrderListBean;
import com.dtw.ditouwang.beans.PersonBean;
import com.dtw.ditouwang.beans.PhotoDetailBean;
import com.dtw.ditouwang.beans.ProductBean;
import com.dtw.ditouwang.beans.ProductDetailBean;
import com.dtw.ditouwang.beans.RankingBean;
import com.dtw.ditouwang.beans.RecordBean;
import com.dtw.ditouwang.beans.ReportBean;
import com.dtw.ditouwang.beans.SetUserHeadBackBean;
import com.dtw.ditouwang.beans.SySArtBean;
import com.dtw.ditouwang.beans.UserBean;
import com.dtw.ditouwang.beans.UserSendCollectBean;
import com.dtw.ditouwang.beans.WechatUserBean;

import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;
import retrofit2.http.Url;

public interface WebApi {
    String BaseUrl = "http://www.ditouwang.net";
    @GET("https://api.weixin.qq.com/sns/userinfo")
    Call<WechatUserBean> getWechatUserInfo(@Query("access_token")String token, @Query("openid")String openID);

    //注册类型type 0手机号 1QQ 2微信
    @GET("API/User/register")
    Call<UserBean> regist(@Query("type") int type, @Query("username") String userPhone, @Query("password") String password,
                          @Query("qqid") String qqid, @Query("qqname") String qqName, @Query("wxnid") String wxid,
                          @Query("wxname") String wxName, @Query("code") String inviteCode,@Query("check_code")String smsCode);

    @GET
    Call<ResponseBody> downloadFile(@Url String fileUrl);

    @GET("API/User/username")
    Call<CommonBean> bindPhone(@Query("id")int userID,@Query("username")String phoneNum);
    @GET("API/User/weixin")
    Call<CommonBean> bindWeichat(@Query("id")int userID,@Query("weixin")String weichatName,@Query("weixinid")String weichatID);

    @GET("API/Index/queryIndex")
    Call<HomeBean> getHomeData(@Query("id") int userID);

    @GET("API/User/userLogin")
    Call<UserBean> login(@Query("type") int type, @Query("username") String userName, @Query("password") String passwrod,@Query("check_doe")String code);

    @GET("API/Motion/queryMileageAndGoldByTypeId")
    Call<MovementFragmentBean> getMovemnt(@Query("id") int userID, @Query("type")int type);

    @GET("API/User/edit")
    Call<CommonBean> setUserInfo(@Query("id") int userID, @Query("name") String name, @Query("birthdate") String birthday
            , @Query("sex") int gender, @Query("age") String age, @Query("nickname") String nickName, @Query("hobby") String hobby,
                                 @Query("address") String address, @Query("stature") String height,@Query("constellation")String constellation);

    @Multipart
    @POST("API/User/uploadHead")
    Call<CommonBean> uploadHead(@Part MultipartBody.Part imageFile);

    @GET("API/User/editHead")
    Call<SetUserHeadBackBean> setUserHead(@Query("id") int userID, @Query("img") String imgPath);

    @GET("API/Find/querySelected")
    Call<EditorChooseBean> getEditorChoose(@Query("all_type") int type);

    @GET("API/Find/querySysArticle")
    Call<MoreBean> getEditorChooseNormal(@Query("all_type") int type, @Query("type_id") int id);

    @GET("API/Find/queryPhotographyList")
    Call<MoreBean> getEditorChoosePhoto(@Query("type") int type,@Query("af_type")int aftype);

    @GET("API/Find/queryArticleInfo")
    Call<PhotoDetailBean> getPhotoDetail(@Query("uid") int userID, @Query("id") int id);

    @GET("API/User/queryMotionOrderInfo")
    Call<RankingBean> getRanking(@Query("id") int userID, @Query("type") int movementType, @Query("order_type") int dateType);

    @GET("API/User/queryMotionRecord")
    Call<RecordBean> getRecord(@Query("id") int userID);

    @GET("API/User/queryNotice")
    Call<NotifyBean> getNotify(@Query("id") int userID, @Query("type") int type);

    @GET("API/User/editPasswordById")
    Call<CommonBean> updatePass(@Query("id") int userID, @Query("old_pass") String oldPass, @Query("new_password") String newPass, @Query("repeat_new_password") String passAgain);

    @GET("API/User/editPassword")
    Call<CommonBean> updatePass(@Query("username") String phone, @Query("new_password") String pass);

    @GET("API/Find/queryArticleCommentOrder")
    Call<CommentBean> getComment(@Query("uid")int userID,@Query("id")int id,@Query("order")int order);

    @GET("API/Find/commentInfo")
    Call<CommentDetialBean> getCommentDetial(@Query("uid") int userID, @Query("id") int commentID);

    @GET("API/Find/commentArticle")
    Call<CommonBean> sendComment(@Query("uid") int userID, @Query("id") int id,@Query("content")String content);

    @GET("API/Find/addSecondComment")
    Call<CommonBean> sendSecondComment(@Query("uid") int userID, @Query("aid") int artID, @Query("id") int id,@Query("content")String content);

    @Multipart
    @POST("API/Find/uplodImg")
    Call<CommonBean> uploadImage(@Part MultipartBody.Part imageFile);

    @GET("API/Find/postArticle")
    Call<CommonBean> sendArt(@Query("id")int userID,@Query("fttype")int type,@Query("content")String content,@Query("img")String images);

    @GET("API/Find/thumbsArticle")
    Call<CommonBean> setAwesome(@Query("uid") int userID, @Query("id") int id, @Query("is_click") int selected);

    @GET("API/Find/collectionArticle")
    Call<CommonBean> setCollection(@Query("uid") int userID, @Query("id") int id, @Query("is_collection") int selected);

    @GET("API/Find/firstCommentThumb")
    Call<CommonBean> setAwesomeForComment(@Query("uid") int userID, @Query("aid") int artID, @Query("id") int commentID, @Query("parent_id") int parentCommentID,@Query("is_click")int selected);

    @GET("API/Find/querySysArticleInfo")
    Call<SySArtBean> getSystemArt(@Query("uid") int userID, @Query("id") int id);

    @GET("API/Motion/queryChallengeListByTypeId")
    Call<ChallengeListBean> getChallengeList(@Query("type") int type);

    @FormUrlEncoded
    @POST("API/Motion/motionCalculation")
    Call<MovementBackBean> upLoadMovement(@Field("param") String movementData);

    @GET("API/User/queryAssetsInfo")
    Call<AssetsBean> getAssets(@Query("id") int userID, @Query("type") int type);

    @GET("API/User/queryMotionMonthAndWeek")
    Call<ReportBean> getReport(@Query("id")int userID, @Query("motion_type")int type, @Query("date_type")int date);

    @GET("API/Medal/queryMedal")
    Call<MyMedalBean> getMyMedal(@Query("id") int userID);

    @GET("API/User/queryIndexByType")
    Call<UserSendCollectBean> getSendCollect(@Query("id") int userID, @Query("type") int type);

    @GET("API/Find/queryReportType")
    Call<FrequenctBean> getFrequency();

    @GET("API/Find/reportArticle")
    Call<CommonBean> sendFrequency(@Query("uid") int userID, @Query("id") int id, @Query("type_id") int type);

    @Multipart
    @POST("API/User/uploadBackground")
    Call<CommonBean> uploadBack(@Part MultipartBody.Part imageFile);

    @GET("API/User/editBackground")
    Call<CommonBean> setBack(@Query("id") int userID, @Query("background") String path);

    @GET("API/Sms/send_verify")
    Call<CommonBean> getCode(@Query("mobile") String phone, @Query("type") int type);

    @GET("API/User/forGetPassword")
    Call<CommonBean> forgetPassword(@Query("phone") String phone, @Query("password") String pass, @Query("check_code") String code);

    @GET("API/Find/queryFindByType")
    Call<MoreBean> getMore(@Query("type") int type);

    @GET("API/User/personPage")
    Call<PersonBean> getUserInfo(@Query("id") int userID);

    @GET("API/Exchange/queryShopList")
    Call<ProductBean> getProduct();

    @GET("API/Exchange/queryCommodityInfo")
    Call<ProductDetailBean> getDetail(@Query("id")int userID, @Query("commodity_id")int productID);

    @GET("/API/Exchange/placeOrder")
    Call<CommonBean> commitOrder(@Query("id")int userID,
                                @Query("commodity_id")int productID,
                                @Query("address")String address,
                                @Query("shop_name")String commName);

    //type 0 全部 1待发货 2待收货 3已收货
    @GET("API/Exchange/queryOrderList")
    Call<OrderListBean> getOrderList(@Query("id")int userID, @Query("status")int type);

    @GET("API/Exchange/shouhuo")
    Call<CommonBean> confirmTranstion(@Query("id")int orderID);

    @GET("API/Help/queryHelpIndex")
    Call<HelpBean> getHelps();

    @GET("API/Help/queryHelpByType")
    Call<HelpBeanList> getHelpList(@Query("type_id")String typeID);

    @GET("API/Help/queryHelpInfo")
    Call<HelpContentBean> getHelpContent(@Query("id")String helpID);
}
